function createAnnualContrastTableForTx(xAxis, series, showPercent, valid,validTableDiv) {
	$("#"+validTableDiv).append('<table class="mintable" align="left"  id="'+validTableDiv+'Table" width="780px" border="1" ></table><br/>');
	if($.browser.msie){		
		$("#"+validTableDiv).append("</br>");
	}
	var thead = "<th></th>";

	for ( var x = 0; x < xAxis.length; x++) {
		thead += "<th>" + xAxis[x] + "</th>";
	}

	$("#"+validTableDiv+"Table").append("<tr>" + thead + "<th>Total</th></tr>");
	for ( var j = series.length - 1; j >= 0; j--) {
		if (j == series.length - 1) {
			var nextTr = "<th> " + series[j].name + "</th>";
			var totalCount = 0;
			for ( var i = 0; i < xAxis.length; i++) {
				if (i < series[j].data.length) {
					if (j == series.length - 1) {
						nextTr += "<td>" + ((series[j].data[i]=='null' ||series[j].data[i]==null)?'':series[j].data[i]) + "</td>";
						totalCount += series[j].data[i];
					}
				} else {
					nextTr += "<td></td>";
				}
			}
			nextTr += "<th>" + totalCount + "</th>";
			$("#"+validTableDiv+"Table").append("<tr>" + nextTr + "</tr>");
		}
	}
	if (showPercent) {
		for ( var j = series.length - 1; j >= 0; j--) {
			if (j != series.length - 1) {
				var nextTr = "<th> VS " + series[j].name + "</th>";
				for ( var i = 0; i < xAxis.length; i++) {
					if (i < series[j].data.length) {
						nextTr += "<td>" + leftTwoDecIgnoreZero(series[series.length - 1].data[i] / series[j].data[i] * 100) + "</td>";
					} else {
						nextTr += "<td></td>";
					}
				}
			}
		}
		//计算与上一年度同比增长的情况
		var total1 = 0;
		var total2 = 0;
		for ( var k = 0; k < valid[valid.length - 1].data.length; k++) {
			for ( var n = 0; n < valid[valid.length - 1].data[k].data.length; n++) {
				total1 += valid[valid.length - 1].data[k].data[n];
			}
		}
		for ( var k = 0; k < valid[0].data.length; k++) {
			for ( var n = 0; n < valid[0].data[k].data.length && n < valid[valid.length - 1].data[0].data.length; n++) {
				total2 += valid[0].data[k].data[n];
			}
		}

		$("#"+validTableDiv+"Table").append("<tr>" + nextTr + "<td>" + leftTwoDecIgnoreZero(1.0 * total1 / total2 * 100) + "</td></tr>");
	}
	if (!showPercent) {
		var vlignAllCount = "";
		for ( var i = 0; i < xAxis.length; i++) {
			var vlignCount = 0;
			var isEnd = false;
			for ( var j = 0; j < series.length; j++) {
				if (i < series[j].data.length) {
					vlignCount += series[j].data[i];
				} else {
					isEnd = true;
					break;
				}
			}
			vlignAllCount += (isEnd ? "" : vlignCount) + ",";
		}
		vlignAllCount = vlignAllCount.substr(0, vlignAllCount.length - 1).split(",");
		var totalVlign = "<tr><th>Total</th>";
		var total = 0;
		for ( var v = 0; v < xAxis.length; v++) {
			totalVlign += "<th>" + vlignAllCount[v] + "</th>";
			total += parseInt(vlignAllCount[v] == '' ? 0 : vlignAllCount[v]);
		}
		$("#"+validTableDiv+"Table").append(totalVlign + "<th>" + total + "</th></tr>");
	}
}
//初始化统计图的展示形式及数据,生成图和表
function createTableAndChart(action) {
	var showPercent = false;
	initLeftMemu();
	var data = getUrlData();
	var msg = getData(data, action);
	var seriesData = ""; //按series的格式{name:name,data:data}接收数据，最终转成json格式
	var seriesName = "";
	var valid = msg.valid;
	var xTitle = "Time(M)";
	if (valid[0].year != valid[valid.length - 1].year && valid.length <= 3) {
		showPercent = true;
	}
	for ( var i = 0; i < valid.length; i++) {
		for ( var n = 0; n < valid[i].data.length; n++) {
			seriesData += "{name:'" + valid[i].year + " " + (valid[i].data[n].type.length == 1 ? valid[i].data[n].type + valid[i].tx : valid[i].tx + " " + valid[i].data[n].type)
					+ "',data:[" + addNullData(valid[i].data[n].data) + "]},";			
		}
	}
	seriesData = seriesData.substr(0, seriesData.length - 1);	
	createTheme();	
	var options = createOptionsSeriesType('container',data.type);
	var xAxisCategories = "['Jan','Feb','Mar','Apr','May','Jun','July','Aug','Sep','Oct','Nov','Dec']";
	options.xAxis.categories = eval("(" + xAxisCategories + ")");//将读取到的数据转成json数组格式	
	options.series = eval("[" + seriesData + "]");//将图例数据部分转成json数组格式
	options.xAxis.title.text = xTitle;
	options.yAxis.title.text = valid[0].tx+" No.";
	options.title.text = replaceWithChar(data.title, "_", " "); //" Number Stat. By Month";
	createAnnualContrastTableForTx(options.xAxis.categories, options.series, showPercent,valid,'dataAnnualContrastDiv');
	createInValidTable(msg.invalid,'invalidTableDiv');
	createChart(options);
}
createTableAndChart('getChart2_2_0_2');